/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package bd;

import bean.ClienteBean;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.ArrayList;
/**
 *
 * @author Alexsandro
 */
public class ClienteBD {

    public boolean insereCliente(ClienteBean cliente) throws SQLException {
		String sql = "INSERT INTO usuario(id,nome,ticket) VALUES(?,?,?)";
		Connection con = BD.getConnection();
		try {
			PreparedStatement ptm = con.prepareStatement(sql);
			ptm.setInt(1, cliente.getId());
			ptm.setString(2, cliente.getNome());
                        ptm.setString(3, cliente.getTicket());
			int row = ptm.executeUpdate();
			if(row == 1) {
				return true;
			}
		} catch (SQLException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return false;
	}

    
}
